package cn.edu.swpu.sims.service.impl;

import cn.edu.swpu.sims.dao.AdminDao;
import cn.edu.swpu.sims.model.Admin;
import cn.edu.swpu.sims.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 码之泪殇
 * @date 2020/9/11 11:28
 * 到达胜利之前，无法回头
 */
@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminDao adminDao;

    @Override
    public Admin getAdminByUsername(String username) {
        return adminDao.getAdminByUsername(username);
    }

    @Override
    public List<Admin> getAllAdmin(String type, String value) {
        return adminDao.getAllAdmin(type, value);
    }

    @Override
    public int saveAdmin(Admin admin) {
        return adminDao.saveAdmin(admin);
    }

    @Override
    public void deleteAdminById(int id) {
        adminDao.deleteAdminById(id);
    }

    @Override
    public Admin getAdminById(int id) {
        return adminDao.getAdminById(id);
    }

    @Override
    public int updateAdmin(Admin admin) {
        return adminDao.updateAdmin(admin);
    }
}
